<template>
    <view>
        <view class="container">
            <!--
<view class="navlist"> 
  <view class="item" bindtap='toMyFind'><image src="../../resource/img/save.png"></image><view>投递进展</view></view>
  <view class="item" bindtap='toMyNotice'><image src="../../resource/img/gz.png"></image><view>面试通知</view></view>
  <view class="item" bindtap='toMylooknote'><image src="../../resource/img/ask.png"></image><view>对我感兴趣</view></view>


</view>
-->
            <view class="list">
                <view class="list_item" v-if="sysmsglist.length > 0" v-for="(item, index) in sysmsglist" :key="index"  @click="go_details(item.id)">
                    <view class="list_content">
                        <view>
                            {{ item.content }}
                            <navigator :url="item.link" hover-class="none"><view v-if="item.link != ''" style="color: blue">【点击查看】</view></navigator>
                        </view>
                        <view>{{ item.createtime }}</view>
                    </view>
                </view>

                <view class="nodata" v-if="sysmsglist.length == 0">
                    <image src="/static/imgs/icon/nodata.png"></image>
                </view>
            </view>
        </view>

		<view class="cu-bar tabbar foot bg-white">
			<view class="action text-gray" @tap="toIndex">
				<view class="cuIcon-homefill"></view>
				首页
			</view>
			<view class="action text-gray" @tap="toFindjob">
				<view class="cuIcon-similar"></view>
				职位
			</view>
			<!-- <view class="action text-gray add-action" @tap="toMyinvate">
				<button class="cu-btn cuIcon-add bg-blue"></button>
				发布
			</view> -->
			<view class="action text-blue" @tap="toSysmsg">
			    <view class="cuIcon-notice"></view>
			    消息
			</view>
			<view class="action text-gray" @tap="toMyuser">
			    <view class="cuIcon-my"></view>
			    我的
			</view>
		</view>
    </view>
</template>

<script>
import { Sysmsg } from '../../model/sysmsg-model.js';
var sysmsg = new Sysmsg();
export default {
    data() {
        return {
            sysmsglist: ''
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        var that = this;
        uni.setNavigationBarTitle({
            title: '消息中心'
        });
        var params = {};
        sysmsg.GetsysmsgList((data) => {
            var sysmsglist = data.sysmsglist;
            that.setData({
                sysmsglist: sysmsglist
            });
            uni.hideNavigationBarLoading(); //完成停止加载
            uni.stopPullDownRefresh();
        }, params);
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
		go_details(id){
			uni.navigateTo({
				url:'/pages/sysmsg/details?id='+id
			})
		},
        toIndex: function () {
            uni.redirectTo({
                url: '/pages/index/index'
            });
        },

        toFindjob: function (e) {
            var that = this;
            uni.redirectTo({
                url: '/pages/findjob/index'
            });
        },

        toMyinvate: function (e) {
            var that = this;
            uni.redirectTo({
                url: '/pages/switchrole/index'
            });
        },

        toSysmsg: function () {
            uni.redirectTo({
                url: '/pages/sysmsg/index'
            });
        },

        toMyuser: function () {
            uni.redirectTo({
                url: '/pages/user/index'
            });
        }
    }
};
</script>
<style>
page {
    background: #f5f5f5;
}
.container {
    background-color: #f5f5f5;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.navlist {
    width: 100%;
    display: flex;
    justify-content: space-around;
    flex-direction: row;
    padding-top: 20rpx;
    flex-wrap: wrap;
    background: #fff;
    height: 240rpx;
    align-items: center;
}

.navlist .item {
    width: 230rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    padding-bottom: 30rpx;
}
.navlist .item image {
    width: 60rpx;
    height: 60rpx;
}

.list {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.list .list_item {
    display: flex;
    flex-direction: row;
    background: #fff;
    margin-top: 10rpx;
    padding: 20rpx;
}

.list_content {
    display: flex;
    flex-direction: column;
}

.list_content view:nth-child(1) {
    font-weight: 500;
    font-size: 12px;
}

.list_content view:nth-child(2) {
    font-size: 12px;
    color: #a2a2a2;
}

.nodata {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 300rpx;
}
.nodata image {
    width: 150rpx;
    height: 150rpx;
}
</style>
